﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using VodafoneLiveTile_2.Resources;
using VodafoneLiveTile;

namespace VodafoneLiveTile_2
{
    public class Config
    {
        public static string Version = "1.4";
        public static string channelName = "VodafoneLiveTileChannel2";
        public static string updateAdsUrl = "http://fboscari.altervista.org/GetAds.php";
        public static string updateCountersUrl = "http://fboscari.altervista.org/Vodafone/VodafoneCounters.php";
        public static string updateToastsUrl = "http://fboscari.altervista.org/Vodafone/VodafoneToasts.php";
        public static string updateTileUrl = "http://fboscari.altervista.org/Vodafone/UpdateAll.php?";
        public static string crackUrl = "http://fboscari.altervista.org/submit_string.php/?tab=Suggerimenti&applicazione=VodafoneLiveTile&dataora=";
        public static string sendAccountDataUrl = "http://fboscari.altervista.org/Vodafone/ManageUris.php?";
        public static string createNewAccountUrl = "https://registrazione.vodafone.it/190/regu/checkLinkAccount.do?key=com_reg";
        public static string UtilizationsName = "Credit/Counter Vodafone";

        private static string updateCountersUrl_business = "http://fboscari.altervista.org/VodafoneBusiness/VodafoneBusinessCounters.php";
        private static string updateToastsUrl_business = "http://fboscari.altervista.org/VodafoneBusiness/VodafoneBusinessToasts.php";
        private static string updateTileUrl_business = "http://fboscari.altervista.org/VodafoneBusiness/VodafoneBusinessUpdateAll.php?";
        private static string sendAccountDataUrl_business = "http://fboscari.altervista.org/VodafoneBusiness/VodafoneBusinessManageUris.php?";

        public static void LoadDefaultCounter(List<Counter> list)
        {
            list.Add(new Counter(0, "Undefined", ""));

            list.Add(new Counter(1, "Vodafone Credit", ""));
            list.Add(new Counter(2, "Mobile Internet", ""));
            list.Add(new Counter(3, "Smart Zero Limits", ""));
        }
        public static Boolean LoggedInCondition(string html)
        {
            return html.Contains("Ciao ") && html.Contains("Logout");
        }
        public static Boolean IsBusinessCondition(string html)
        {
            return false;// html.Contains("Business");
        }

        public static string get_updateCountersUrl(bool isBusiness)
        {
            if (isBusiness)
                return updateCountersUrl_business;
            else
                return updateCountersUrl;
        }

        public static string get_updateToastsUrl(bool isBusiness)
        {
            if (isBusiness)
                return updateToastsUrl_business;
            else
                return updateToastsUrl;
        }

        public static string get_updateTileUrl(bool isBusiness)
        {
            if (isBusiness)
                return updateTileUrl_business;
            else
                return updateTileUrl;
        }

        public static string get_sendAccountDataUrl(bool isBusiness)
        {
            if (isBusiness)
                return sendAccountDataUrl_business;
            else
                return sendAccountDataUrl;
        }
    }
}
